package com.example.demo.exception;

import org.springframework.stereotype.Component;

//自定义异常类

public class GlobalException extends RuntimeException {
    //错误消息
    private CodeMsg codeMsg;

    public GlobalException(CodeMsg codeMsg){
        this.codeMsg=codeMsg;
    }

    //@Override
    //public String getMessage() {
    //    return codeMsg.getMsg();
    //}
    public CodeMsg getCodeMsg(){
        return codeMsg;
    }

}
